#ifndef PUB_DEFS_H
#define PUB_DEFS_H

// 3D class
class TD {
private:
    double x,y,z;
public:
    TD(double a=0, double b=0, double c=0);
    TD operator+(const TD& other) const;
    TD operator-(const TD& other) const;
    TD operator*(double a) const;
    TD operator/(double a) const;
    bool operator==(const TD& other) const;
};

#define F_routine(i) TD((i)*(i)+5, (i)*(i)+6, (i)*(i)+7)
#define M 1.0
#define DT 1e-6

int write_infile(TD* x, TD* v, int n);

int write_outfile(TD* x, TD* v, int n);

int read_infile(TD* x, TD* v, int n);

int read_outfile(TD* x, TD* v, int n);

double wall_time();

template<typename T>
bool compare_array(T* a, T* b, int n);

#endif // PUB_DEFS_H
